package com.aaa.controller;



import com.aaa.service.StockService_redisson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: TODO
 * @date 2022/12/8
 */
@RestController
public class StockController {

    @Autowired
    private StockService_redisson stockService;

//    根据商品编号减库存
    @GetMapping("/incr/{productid}")
    public String incr(@PathVariable Integer productid){
        return stockService.decrement(productid);
    }
}
